{/* LAYOUT模板 */}
<layout name="layout"/>
{/* LAYOUT模板 */}
{/* import Js,Css */}		
<css href="__CSS__/admin/common.css"/>
<css href="__CSS__/jquery-ui.css" />
<js href="__JS__/admin/js.util.js"/>	
<js href="__JS__/core/jquery-ui.1.10.4.js" />
<js href="__JS__/core/plugins.js"/>
<js href="__JS__/core/jquery.form.js"/>
{/* import js,css */}
<include file="Template:position"/>

<div id="loading"><!--加载条--></div>

<div class="main-div">
	<form id="add-goodstype-form" method="post" name="theForm">
		<table cellspacing="1" cellpadding="3" width="100%">
			<tr>
				<td class="label" align="right">品类型名称:&nbsp;&nbsp;</td>
				<td>
					<input type="text" name="cat_name" value="{$goods_type.cat_name}" size="40" />
					*
				</td>
			</tr>
			<tr style="display:none">
				<td class="label" align="right">{$lang.goods_type_status}:&nbsp;&nbsp;</td>
				<td>{html_radios name="enabled" options=$lang.arr_goods_status checked=$goods_type.enabled}</td>
			</tr>			
			<tr>
				<td class="label" align="right">
					<a href="javascript:showNotice('noticeAttrGroups');" title="{$lang.form_notice}">
						<img src="__IMG__/admin/notice.gif" width="16" height="16" border="0" alt="{$lang.form_notice}">
					</a> 属性分组:&nbsp;&nbsp;
				</td>
				<td>
					<textarea name="attr_group" rows="5" cols="40">{$goods_type.attr_group}</textarea><br />
					<span class="notice-span"  id="noticeAttrGroups">每行一个商品属性组。排序也将按照自然顺序排序</span>
				</td>
			</tr>
			<tr>
				<td class="label" align="right">状态:&nbsp;&nbsp;</td>
				<td>
					<input type="radio" name="enabled" <if condition="$goods_type['enabled'] eq 1">checked=""</if>  value="1"/>是
					<input type="radio" name="enabled" <if condition="$goods_type['enabled'] eq 0">checked=""</if> value="0"/>否
				</td>
			</tr>
			<tr align="center">
				<td colspan="2">
					<input type="hidden" name="cat_id" value="{$goods_type.cat_id}" />
					<input id="submit-btn" type="button" value="确定" class="button" />
					<input type="reset" value="重置" class="button" />
					<input type="hidden" name="act" value="{$form_act}" />
				</td>
			</tr>
		</table>
	</form>
</div>

<script>
/*提交表单*/
$('#submit-btn').click(function(){
	var values	=	$('#add-goodstype-form').QVal();
	if(values.cat_name == ''){
		alert("商品类型名城不能为空");
		return;
	}
	$('#add-goodstype-form').ajaxSubmit({
		url:'__URL__/{$act}',
		dataType:'json',
		beforeSubmit:function(){
			$('#loading').QLoading({text:'操作中...',modal:false,status:'open'});
		},
		success:function(msg){
			if(msg.data == '1'){
				$('#loading').QLoading({img:'happy',text:'操作成功',modal:false,status:'close',time:1.5});				
			}
			else{
				$('#loading').QLoading({img:'sad',text:'操作失败',modal:false,status:'close',time:1.5});
			}
		}
	});
});
</script>












